package com.dlwx.parttimetalent.adapter;

import android.app.Activity;
import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.dlwx.parttimetalent.R;
import com.dlwx.parttimetalent.bean.ApplyListBean;
import com.tbruyelle.rxpermissions2.RxPermissions;

/**
 * Created by Administrator on 2017/11/21.
 */

public class ApplyAdapter extends ListBaseAdapter<ApplyListBean.BodyBean> {
    private RxPermissions rxpermission;
    private Context context;

    public ApplyAdapter(Context context) {
        super(context);
        this.context = context;
        rxpermission = new RxPermissions((Activity) context);
    }

    @Override
    public int getLayoutId() {
        return R.layout.item_contacts;
    }

    @Override
    public void onBindItemHolder(SuperViewHolder holder, int position) {
        final ApplyListBean.BodyBean bean = getDataList().get(position);
        TextView tvName = holder.getView(R.id.tv_name);
        ImageView image_header = holder.getView(R.id.image_header);
        TextView tvRemark = holder.getView(R.id.tv_remark);
        TextView tvConfirm = holder.getView(R.id.tv_confirm);
        tvConfirm.setText("下单用人");
        tvName.setText(bean.getNickname());
        tvRemark.setText(bean.getBmtime());
        Glide.with(context).load(bean.getHeadurl()).into(image_header);
//        tvConfirm.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                CallPhoneUtil.call(context,bean.getPhone_no());
//            }
//        });

    }
}
